package com.example.inventoryservice.company;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

// 财务数据模型 - 封装企业财务信息
public class CompanyFinancialData {
    private String companyType; // 企业类型
    private BigDecimal annualRevenue; // 年度收入
    private BigDecimal deductibleExpenses; // 可扣除费用
    private BigDecimal taxableIncome; // 应纳税所得额
    private int employeeCount; // 员工人数
    private BigDecimal totalAssets; // 资产总额
    private List<BigDecimal> quarterlyTaxPrepayments; // 季度预缴税额
    private LocalDate establishmentDate; // 成立日期

    // 构造函数、getter和setter省略
    public CompanyFinancialData(String companyType, BigDecimal annualRevenue, BigDecimal deductibleExpenses, int employeeCount, BigDecimal totalAssets, LocalDate establishmentDate) {
        this.companyType = companyType;
        this.annualRevenue = annualRevenue;
        this.deductibleExpenses = deductibleExpenses;
        this.employeeCount = employeeCount;
        this.totalAssets = totalAssets;
        this.establishmentDate = establishmentDate;
        this.quarterlyTaxPrepayments = new ArrayList<>();
        // 计算应纳税所得额
        this.taxableIncome = annualRevenue.subtract(deductibleExpenses);
    }

    // Getters
    public String getCompanyType() {
        return companyType;
    }

    public BigDecimal getTaxableIncome() {
        return taxableIncome;
    }

    public int getEmployeeCount() {
        return employeeCount;
    }

    public BigDecimal getTotalAssets() {
        return totalAssets;
    }

    public List<BigDecimal> getQuarterlyTaxPrepayments() {
        return quarterlyTaxPrepayments;
    }

    public LocalDate getEstablishmentDate() {
        return establishmentDate;
    }

    public BigDecimal getDeductibleExpenses() {
        return deductibleExpenses;
    }
    public void addQuarterlyPrepayment(BigDecimal amount) {
        quarterlyTaxPrepayments.add(amount);
    }
}
